package org.example.est.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import lombok.Data;

/**
 * pay_order
 * @author 
 */
@Data
public class PayOrder implements Serializable {
    private Long id;

    /**
     * 订单编号
     */
    private String orderno;

    /**
     * 支付订单号
     */
    private String payno;

    /**
     * 阿里交易订单号
     */
    private String alitradeno;

    /**
     * 用户id
     */
    private Long userid;

    /**
     * 支付金额
     */
    private BigDecimal price;

    /**
     * 支付类型（1:定金,2:尾款）
     */
    private Integer paytype;

    /**
     * 支付状态（1:未支付,2:支付成功,3:支付失败）
     */
    private Integer status;

    /**
     * 支付途径（1:现金,2:刷卡,3:支付宝,4:微信）
     */
    private Integer paychannel;

    /**
     * 创建人
     */
    private Long createduserid;

    /**
     * 修改人
     */
    private Long updateduserid;

    /**
     * 创建时间
     */
    private Date createdtime;

    /**
     * 修改时间
     */
    private Date updatedtime;

    /**
     * 是否删除(0:否,1:是)
     */
    private Integer isdelete;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        PayOrder other = (PayOrder) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getOrderno() == null ? other.getOrderno() == null : this.getOrderno().equals(other.getOrderno()))
            && (this.getPayno() == null ? other.getPayno() == null : this.getPayno().equals(other.getPayno()))
            && (this.getAlitradeno() == null ? other.getAlitradeno() == null : this.getAlitradeno().equals(other.getAlitradeno()))
            && (this.getUserid() == null ? other.getUserid() == null : this.getUserid().equals(other.getUserid()))
            && (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
            && (this.getPaytype() == null ? other.getPaytype() == null : this.getPaytype().equals(other.getPaytype()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getPaychannel() == null ? other.getPaychannel() == null : this.getPaychannel().equals(other.getPaychannel()))
            && (this.getCreateduserid() == null ? other.getCreateduserid() == null : this.getCreateduserid().equals(other.getCreateduserid()))
            && (this.getUpdateduserid() == null ? other.getUpdateduserid() == null : this.getUpdateduserid().equals(other.getUpdateduserid()))
            && (this.getCreatedtime() == null ? other.getCreatedtime() == null : this.getCreatedtime().equals(other.getCreatedtime()))
            && (this.getUpdatedtime() == null ? other.getUpdatedtime() == null : this.getUpdatedtime().equals(other.getUpdatedtime()))
            && (this.getIsdelete() == null ? other.getIsdelete() == null : this.getIsdelete().equals(other.getIsdelete()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getOrderno() == null) ? 0 : getOrderno().hashCode());
        result = prime * result + ((getPayno() == null) ? 0 : getPayno().hashCode());
        result = prime * result + ((getAlitradeno() == null) ? 0 : getAlitradeno().hashCode());
        result = prime * result + ((getUserid() == null) ? 0 : getUserid().hashCode());
        result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
        result = prime * result + ((getPaytype() == null) ? 0 : getPaytype().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getPaychannel() == null) ? 0 : getPaychannel().hashCode());
        result = prime * result + ((getCreateduserid() == null) ? 0 : getCreateduserid().hashCode());
        result = prime * result + ((getUpdateduserid() == null) ? 0 : getUpdateduserid().hashCode());
        result = prime * result + ((getCreatedtime() == null) ? 0 : getCreatedtime().hashCode());
        result = prime * result + ((getUpdatedtime() == null) ? 0 : getUpdatedtime().hashCode());
        result = prime * result + ((getIsdelete() == null) ? 0 : getIsdelete().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", orderno=").append(orderno);
        sb.append(", payno=").append(payno);
        sb.append(", alitradeno=").append(alitradeno);
        sb.append(", userid=").append(userid);
        sb.append(", price=").append(price);
        sb.append(", paytype=").append(paytype);
        sb.append(", status=").append(status);
        sb.append(", paychannel=").append(paychannel);
        sb.append(", createduserid=").append(createduserid);
        sb.append(", updateduserid=").append(updateduserid);
        sb.append(", createdtime=").append(createdtime);
        sb.append(", updatedtime=").append(updatedtime);
        sb.append(", isdelete=").append(isdelete);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}